Documentation for Users  1.0.2
Perception Toolbox for Virtual Reality (PTVR) Manual
The scene

Introduction

The Scene is a crucial concept in PTVR !

To give a first concrete idea of its use, let's assume that we want to create an animation during which one cone stays static while a second cone moves away from the first cone. This is created here parsimoniously with three scenes (see figure 1).

Figure 1: Animation made of three successive scenes: this creates apparent motion of the second cone with respect to the first cone.


A PTVR scene is a very simple PTVR object although potentially confusing as the 'scene' concept is associated with different meanings in different fields.

The exact name of this object is VisualScene and it is created as shown in the code below:

 my_scene = PTVR.Stimuli.Scenes.VisualScene ()

Links with different terminologies used in Vision Science

A PTVR scene is very close to the concept of an image as explained in the 'Using OpenGL' section of the OpenGL documentation [1].

... the general way to use OpenGL is to draw everything you need to draw, then show this image with a platform-dependent buffer swapping command. If you need to update the image, you draw everything again, .... If you want to animate objects moving on the screen, you need a loop that constantly clears and redraws the screen.

The PTVR scene is also close to the concept of :

  • a slide in a slide show (or slide presentation)
  • a picture as in the definition of motion picture below (Merriam-Webster):

definition of motion picture (movie) : a series of pictures projected on a screen in rapid succession with objects shown in successive positions slightly changed so as to produce the optical effect of a continuous picture in which the objects move.


Beware : For those familiar with Unity, the PTVR scene is NOT the same as the Unity scene. Sorry about this !


😎 Tip: The best way to get familiar with the PTVR VisualScene object and its use is to look at the following Demos :


Demos

Demos on the DURATION of scenes

😎 Tip: For explanations on 'simplified interactions' see section Simplified Interactions ..

The path of demos is :
...\PTVR_Researchers\Python_Scripts\Demos\Scenes\

Python file

Description

1_one_scene_w_simplified_duration.py

displays one scene whose duration is defined by a simplified interaction.

2_one_scene_w_NON_simplified_duration.py

displays one scene whose duration is not defined by a simplified interaction. It requires therefore to define an Event, an Callback and their interaction.

3_cycle_of_scenes_w_simplified_duration.py

displays a cyclic presentation of a few scenes whose duration is defined by a simplified interaction.

4_cycle_of_scenes_w_NON_simplified_duration.py

displays a cyclic presentation of a few scenes whose duration is NOT defined by a simplified interaction.


Demos on the number of scenes per TRIAL

The path of demos is :
...\PTVR_Researchers\Python_Scripts\Demos\Experiment_building\

Python file

Description

1_loop_of_trials_w_one_scene_per_trial.py

The smallest experiment : each trial is made of ONE PTVR scene.

2_loop_of_trials_w_several_scenes_per_trial.py

A slightly more complex experiment : each trial is made of SEVERAL PTVR scenes.